﻿@model EagleProject.LinQDataContext.Eventt

@{
    ViewBag.Title = "CreateEvent";
}

@if (ViewBag.RegisterSuccess != null && ViewBag.RegisterSuccess)
{
    <h2>Register Successed !</h2>
}
else
{
    using (Html.BeginForm("CreateEvent", "Admin", FormMethod.Post))
    {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Create Event</legend>
        <ol>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.Name)</div>
                <div class="tbl-next">@Html.TextBoxFor(m => m.Name)</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.Name)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.PartnerID)</div>
                <div class="tbl-next">@Html.DropDownListFor(m => m.PartnerID, ViewBag.ListPartner as SelectList, "Select Partner")</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.PartnerID)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.Location)</div>
                <div class="tbl-next">@Html.TextBoxFor(m => m.Location)</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.Location)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first"><label for="StateID">State</label></div>
                <div class="tbl-next">@Html.DropDownList("StateID", ViewBag.ListState as SelectList, "All", new { id = "StateID" })</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.LGAID)</div>
                <div class="tbl-next">@Html.DropDownList("LGAID", ViewBag.ListLGAs as SelectList, "Select Local Gov Area", new { id = "LGAID" })</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.LGAID)</div>
                <div class="clear"></div>
            </li>
        </ol>
        <input type="submit" name="Submit" id="Submit" value="Submit" class="btn" />
    </fieldset>
    
    @section Scripts {
        @Scripts.Render("~/bundles/jqueryval")
    }

    <script src="@Url.Content("~/Scripts/jquery-1.7.1.js")"></script>
    <script src="@Url.Content("~/DataScript/webApi.js")"></script>
    <script>
        apiUrl = '@Url.Content("~/api/lga/")';
        registerUpdate('StateID', 'LGAID', 'Select Local Gov Area', apiUrl);
    </script>
    
    }
}